package pl.vanta.utils.commons;

public class ArraysUtils
{
	private ArraysUtils()
	{
	}

	public static int sum(int[] array)
	{
		if (array == null)
		{
			return Integer.MIN_VALUE;
		}

		int sum = 0;

		for (int i = 0; i < array.length; i++)
		{
			sum += array[i];
		}

		return sum;
	}

	public static boolean contains(int[] tab, int search)
	{
		if (tab == null)
		{
			return false;
		}

		for (int i = 0; i < tab.length; i++)
		{
			if (tab[i] == search)
			{
				return true;
			}
		}

		return false;
	}
}
